<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
<?php echo "Sites"; ?>
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
<div id="content" class="box">
	<h1>Sites</h1>
	<div id="menu" class="box">
		<ul class="box">
			<li><a href="<?php echo url('site/add');?>"><span>Add</span></a></li>				
		</ul>
	</div>
		<?php if (isset($infos)) 
				{
					foreach ($infos as $info)
					{
		?>
				<p class="msg info"><?php echo $info;?></p>
		<?php		}
				}
		?>
	<table class="full-size" style="text-align:center;">
		<tbody>
			<tr>
				<th>Name</th>
				<th>Domain</th>
				<th>Jackpot</th>
				<th>Creatives</th>
				<th>Actions</th>
			</tr>
			<?php
				$bg = false;
				
				if(!empty($sites)){		
					foreach ($sites as $site)
					{
			?>
			<tr <?php if ($bg) echo 'class="bg"';?>>
				<td><?php echo $site['name']; ?></td>
				<td><?php echo $site['domain'];?></td>
				<td><?php echo $site['jackpot'];?></td>
				<td><a href="<?php echo url('creative/show', array('site_id'=>$site['id']));?>"><?php echo $site['creatives'];?></a></td>
				<td>
				<a href="<?php echo url('site/edit', array('id'=>$site['id']));?>">Edit</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="<?php echo url('site/deleteconfirm', array('id'=>$site['id']));?>">Delete</a>
				</td>
			</tr>
			<?php
						$bg = !$bg;
					}
				}
			?>
		</tbody>
	</table>
</div>
<?php $this->_endblock(); ?>
